/* 
   Vicious
   Made by ups2000ups
   cleaned up by wackyracer
*/

void npc(Player @player, NPC @npc) {
	int state = npc.getState();
	int type = npc.getSelected();
	npc.setVariable("type", type);

	string [] menu 		= {"Make a Bow", "Make a Crossbow", "Make a Glove", "Upgrade a Glove", "Create materials", "Create arrows"};
	int menux = 6; // the amount of options in the menu

	int [] _temp				= {0,0,0,0,0,0,0,0,0,0};
	int [] _tempinfo			= {0,0,0,0,0,0,0,0,0,0};
	int [] _tempinfox			= {0,0,0,0,0,0,0,0,0,0};
	int z = 0;

	// --------------------------------- Materials
	string [] _MaterialMenu		= {"Make Processed Wood with Tree Branch", "Make Processed Wood with Firewood", "Make Screw"};
	int _MaterialMenux = 3; // the amount of options in the menu

	int [] _ProcessedWood_v1 	= {3,4003001, 4000003};
	int [] _ProcessedWood_v1info 	= {0,999    , 10};
	int [] _ProcessedWood_v1infox 	= {0,1      , 0};
	int [] _ProcessedWood_v2 	= {3,4003001, 4000018};
	int [] _ProcessedWood_v2info 	= {0,999    , 5};
	int [] _ProcessedWood_v2infox 	= {0,1      , 0};
	int [] _Screws			= {4,4003000, 4011001, 4011000};
	int [] _Screwsinfo		= {0,999    , 1      , 1};
	int [] _Screwsinfox		= {0,15     , 0      , 0};

	// -------------------------------- Arrows
	string [] _ArrowMenu 		= {"Arrow for Bow", "Arrow for Crossbow", "Bronze Arrow for Bow", "Bronze Arrow for Crossbow"};
	int _ArrowMenux = 4; // the amount of options in the menu

	int [] _Bow	 	= {4,2060000, 4003001, 4003004};
	int [] _Bowinfo 	= {0,999    , 1      , 1};
	int [] _Bowinfox 	= {0,1000   , 0      , 0};
	int [] _CBow	 	= {4,2061000, 4003001, 4003004};
	int [] _CBowinfo 	= {0,999    , 1      , 1};
	int [] _CBowinfox 	= {0,1000   , 0      , 0};
	int [] _BBow	 	= {5,2060001, 4011000, 4003001, 4003004};
	int [] _BBowinfo 	= {0,999    , 1      , 3      , 10};
	int [] _BBowinfox 	= {0,900    , 0      , 0      , 0};
	int [] _BCBow	 	= {5,2061001, 4011000, 4003001, 4003004};
	int [] _BCBowinfo 	= {0,999    , 1      , 3      , 10};
	int [] _BCBowinfox 	= {0,900    , 0      , 0      , 0};

	// -------------------------------- Upgrade Glove
	int [] upg		= {1082014, 1082015, 1082017, 1082018, 1082049, 1082050, 1082069, 1082070, 1082072, 1082073, 1082085, 1082083, 1082090, 1082091};
	int upgx 		= 14;
	string [] upginfo	= {"(level limit : 20, Bowman)", "(level limit : 20, Bowman)", "(level limit : 25, Bowman)", "(level limit : 25, Bowman)", "(level limit : 30, Bowman)", "(level limit : 30, Bowman)", "(level limit : 35, Bowman)", "(level limit : 35, Bowman)", "(level limit : 40, Bowman)", "(level limit : 40, Bowman)", "(level limit : 50, Bowman)", "(level limit : 50, Bowman)", "(level limit : 60, Bowman)", "(level limit : 60, Bowman)"};

	int [] _RedDiros		= {5,1082013,4021000,0005000,1082014};
	int [] _RedDirosinfo		= {0,1      ,1      ,0      ,999};	
	int [] _RedDirosinfox		= {0,0      ,0      ,0      ,1};
	int [] _GreenDiros		= {5,1082013,4021003,0007000,1082015};
	int [] _GreenDirosinfo		= {0,1      ,2      ,0      ,999};	
	int [] _GreenDirosinfox		= {0,0      ,0      ,0      ,1};
	int [] _RedSavanta		= {5,1082016,4021000,0010000,1082017};
	int [] _RedSavantainfo		= {0,1      ,3      ,0      ,999};	
	int [] _RedSavantainfox		= {0,0      ,0      ,0      ,1};
	int [] _DarkSavanta		= {5,1082016,4021008,0012000,1082018};
	int [] _DarkSavantainfo		= {0,1      ,1      ,0      ,999};	
	int [] _DarkSavantainfox	= {0,0      ,0      ,0      ,1};
	int [] _GreenMarker		= {5,1082048,4021003,0015000,1082049};
	int [] _GreenMarkerinfo		= {0,1      ,3      ,0      ,999};	
	int [] _GreenMarkerinfox	= {0,0      ,0      ,0      ,1};
	int [] _BlackMarker		= {5,1082048,4021008,0020000,1082050};
	int [] _BlackMarkerinfo		= {0,1      ,1      ,0      ,999};	
	int [] _BlackMarkerinfox	= {0,0      ,0      ,0      ,1};
	int [] _MithrilScaler		= {5,1082068,4011002,0022000,1082069};
	int [] _MithrilScalerinfo	= {0,1      ,4      ,0      ,999};	
	int [] _MithrilScalerinfox	= {0,0      ,0      ,0      ,1};
	int [] _GoldScaler		= {5,1082068,4011006,0025000,1082070};
	int [] _GoldScalerinfo		= {0,1      ,2      ,0      ,999};	
	int [] _GoldScalerinfox		= {0,0      ,0      ,0      ,1};
	int [] _GoldBrace		= {5,1082071,4011006,0030000,1082072};
	int [] _GoldBraceinfo		= {0,1      ,4      ,0      ,999};	
	int [] _GoldBraceinfox		= {0,0      ,0      ,0      ,1};
	int [] _DarkBrace		= {5,1082071,4021008,0040000,1082073};
	int [] _DarkBraceinfo		= {0,1      ,2      ,0      ,999};	
	int [] _DarkBraceinfox		= {0,0      ,0      ,0      ,1};
	int [] _RedWillow		= {6,1082084,4021000,4011000,0055000,1082085};
	int [] _RedWillowinfo		= {0,1      ,5      ,1      ,0      ,999};	
	int [] _RedWillowinfox		= {0,0      ,0      ,0      ,0      ,1};
	int [] _DarkWillow		= {6,1082084,4021008,4011006,0060000,1082083};
	int [] _DarkWillowinfo		= {0,1      ,2      ,2      ,0      ,999};	
	int [] _DarkWillowinfox		= {0,0      ,0      ,0      ,0      ,1};
	int [] _SephiaGarner		= {6,1082089,4021007,4021000,0070000,1082090};
	int [] _SephiaGarnerinfo	= {0,1      ,1      ,5      ,0      ,999};	
	int [] _SephiaGarnerinfox	= {0,0      ,0      ,0      ,0      ,1};
	int [] _DarkGarber		= {6,1082089,4021007,4021008,0080000,1082091};
	int [] _DarkGarberinfo		= {0,1      ,2      ,2      ,0      ,999};	
	int [] _DarkGarberinfox		= {0,0      ,0      ,0      ,0      ,1};

	// -------------------------------------- Make Glove

	int [] mg		= {1082012, 1082013, 1082016, 1082048, 1082068, 1082071, 1082084, 1082089};
	int mgx 		= 8;
	string [] mginfo	= {"(level limit : 15, Bowman)", "(level limit : 20, Bowman)", "(level limit : 25, Bowman)", "(level limit : 30, Bowman)", "(level limit : 35, Bowman)", "(level limit : 40, Bowman)", "(level limit : 50, Bowman)", "(level limit : 60, Bowman)",};

	int [] _BasicArcherGlove	= {5,4000021,4000009,0005000,1082012};
	int [] _BasicArcherGloveinfo	= {0,15     ,20     ,0      ,999};	
	int [] _BasicArcherGloveinfox	= {0,0      ,0      ,0      ,1};
	int [] _BlueDiros		= {6,4000021,4000009,4011001,0010000,1082013};
	int [] _BlueDirosinfo		= {0,20     ,20     ,2      ,0      ,999};	
	int [] _BlueDirosinfox		= {0,0      ,0      ,0      ,0      ,1};
	int [] _BlueSavata		= {6,4000021,4000009,4011006,0015000,1082016};
	int [] _BlueSavatainfo		= {0,40     ,50     ,2      ,0      ,999};	
	int [] _BlueSavatainfox		= {0,0      ,0      ,0      ,0      ,1};
	int [] _BrownMarker		= {6,4000021,4021001,4011006,0020000,1082048};
	int [] _BrownMarkerinfo		= {0,50     ,1      ,2      ,0      ,999};	
	int [] _BrownMarkerinfox	= {0,0      ,0      ,0      ,0      ,1};
	int [] _BronzeScaler		= {7,4000021,4011001,4011000,4003000,0030000,1082068};
	int [] _BronzeScalerinfo	= {0,60     ,3      ,1      ,15     ,0      ,999};	
	int [] _BronzeScalerinfox	= {0,0      ,0      ,0      ,0      ,0      ,1};
	int [] _AquaBrace		= {8,4000021,4021002,4011001,4021000,4003000,0040000,1082071};
	int [] _AquaBraceinfo		= {0,80     ,3      ,3      ,1      ,25     ,0      ,999};	
	int [] _AquaBraceinfox		= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};
	int [] _BlueWillow		= {8,4011004,4021002,4011006,4000030,4003000,0050000,1082084};
	int [] _BlueWillowinfo		= {0,3      ,2      ,1      ,40     ,35     ,0      ,999};	
	int [] _BlueWillowinfox		= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};
	int [] _OakerGarner		= {8,4011007,4021006,4011006,4000030,4003000,0070000,1082089};
	int [] _OakerGarnerinfo		= {0,1      ,8      ,2      ,50     ,50     ,0      ,999};	
	int [] _OakerGarnerinfox	= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};

	// ------------------------------------------- Make Crossbow

	int [] mcb		= {1462001, 1462002, 1462003, 1462000, 1462004, 1462005, 1462006, 1462007};
	int mcbx 		= 8;
	string [] mcbinfo	= {"(level limit : 12, Bowman)", "(level limit : 18, Bowman)", "(level limit : 22, Bowman)", "(level limit : 28, Bowman)", "(level limit : 32, Bowman)", "(level limit : 38, Bowman)", "(level limit : 42, Bowman)", "(level limit : 50, Bowman)"};

	int [] _Crossbow		= {8,4003001,4003000,0001000,0000000,0000000,0000000,1462001};
	int [] _Crossbowinfo		= {0,7      ,2      ,0      ,0      ,0      ,0      ,999};	
	int [] _Crossbowinfox		= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};
	int [] _BattleCrossbow		= {8,4003001,4011001,4003000,0002000,0000000,0000000,1462002};
	int [] _BattleCrossbowinfo	= {0,20     ,1      ,5      ,0      ,0      ,0      ,999};	
	int [] _BattleCrossbowinfox	= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};
	int [] _Balanche		= {8,4003001,4011001,4003000,0003000,0000000,0000000,1462003};
	int [] _Balancheinfo		= {0,50     ,1      ,8      ,0      ,0      ,0      ,999};	
	int [] _Balancheinfox		= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};
	int [] _MountainCrossbow	= {8,4011001,4021006,4021002,4003000,0010000,0000000,1462000};
	int [] _MountainCrossbowinfo	= {0,2      ,1      ,1      ,10     ,0      ,0      ,999};	
	int [] _MountainCrossbowinfox	= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};
	int [] _EagleCrow		= {8,4011001,4011005,4021006,4003001,4003000,0030000,1462004};
	int [] _EagleCrowinfo		= {0,5      ,5      ,3      ,50     ,15     ,0      ,999};	
	int [] _EagleCrowinfox		= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};
	int [] _Heckler			= {8,4021008,4011001,4011006,4021006,4003000,0050000,1462005};
	int [] _Hecklerinfo		= {0,1      ,8      ,4      ,2      ,30     ,0      ,999};	
	int [] _Hecklerinfox		= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};
	int [] _SilverCrow		= {8,4021008,4011004,4003001,4003000,0080000,0000000,1462006};
	int [] _SilverCrowinfo		= {0,2      ,6      ,30     ,30     ,0      ,0      ,999};	
	int [] _SilverCrowinfox		= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};
	int [] _Rower			= {8,4021008,4011006,4021006,4003001,4003000,0100000,1462007};
	int [] _Rowerinfo		= {0,2      ,5      ,3      ,40     ,40     ,0      ,999};	
	int [] _Rowerinfox		= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};

	// ------------------------------------------- Make Bow

	int [] mb		= {1452002, 1452003, 1452001, 1452000, 1452005, 1452006, 1452007};
	int mbx 		= 7;
	string [] mbinfo	= {"(level limit : 10, Bowman)", "(level limit : 15, Bowman)", "(level limit : 20, Bowman)", "(level limit : 25, Bowman)", "(level limit : 30, Bowman)", "(level limit : 35, Bowman)", "(level limit : 40, Bowman)"};

	int [] _WarBow			= {8,4003001,4000000,0000800,0000000,0000000,0000000,1452002};
	int [] _WarBowinfo		= {0,5      ,30     ,0      ,0      ,0      ,0      ,999};	
	int [] _WarBowinfox		= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};

	int [] _CompositeBow		= {8,4011001,4003000,0002000,0000000,0000000,0000000,1452003};
	int [] _CompositeBowinfo	= {0,1      ,3      ,0      ,0      ,0      ,0      ,999};	
	int [] _CompositeBowinfox	= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};

	int [] _HuntersBow		= {8,4003001,4000016,0003000,0000000,0000000,0000000,1452001};
	int [] _HuntersBowinfo		= {0,30     ,50     ,0      ,0      ,0      ,0      ,999};	
	int [] _HuntersBowinfox		= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};

	int [] _BattleBow		= {8,4011001,4021006,4003000,0005000,0000000,0000000,1452000};
	int [] _BattleBowinfo		= {0,2      ,2      ,8      ,0      ,0      ,0      ,999};	
	int [] _BattleBowinfox		= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};

	int [] _Ryden			= {8,4011001,4011006,4021003,4021006,4003000,0030000,1452005};
	int [] _Rydeninfo		= {0,5      ,5      ,3      ,2      ,30     ,0      ,999};	
	int [] _Rydeninfox		= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};

	int [] _RedViper		= {8,4011004,4021000,4021004,4003000,0040000,0000000,1452006};
	int [] _RedViperinfo		= {0,7      ,6      ,3      ,35     ,0      ,0      ,999};	
	int [] _RedViperinfox		= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};

	int [] _Vaulter2000		= {8,4021008,4011001,4011006,4000014,4003000,0080000,1452007};
	int [] _Vaulter2000info		= {0,1      ,10     ,3      ,50     ,40     ,0      ,999};	
	int [] _Vaulter2000infox	= {0,0      ,0      ,0      ,0      ,0      ,0      ,1};

	if(state == 0){
		npc.addText("Hey you! Don't you need something? Well nothing's free around here but... With a few materials and a little service fee, I can make some items for you. So what do you think? Wanna make a deal? Just please make sure no one in this town knows about this.");
		npc.sendYesNo();
	}

	else if(state == 1){
		if(npc.getSelected() == YES){
			npc.addText("Nice! What can I do for you? All you need to do is say it!");
			for(int x = 0; x < menux; x++){
				npc.addText("#b\r\n#L" + (x) + "#" + menu[x] + "#k#l");
			}
			npc.sendSimple();
		}
		if(npc.getSelected() == NO){
			npc.addText("You don't seem to interested. If you need something later on, thought, fell free to come back. I can even hook you up with an item you can't find in stores!");
			npc.sendNext();
			npc.end();
		}
	}

	else if(state == 2){
		if(type == 0){
			npc.addText("I'll make you a Bow if you get me some materials. Which Bow do you want?");
			for(int x = 0; x < mbx; x++){
				npc.addText("#b\r\n#L" + (x) + "##t" + mb[x] + "##k " + mbinfo[x] + "#l");
			}
			npc.setState(59);
			npc.sendSimple();
		}
		if(type == 1){
			npc.addText("I'll make you a Crossbow if you get me some materials. Which Crossbow do you want?");
			for(int x = 0; x < mcbx; x++){
				npc.addText("#b\r\n#L" + (x) + "##t" + mcb[x] + "##k " + mcbinfo[x] + "#l");
			}
			npc.setState(49);
			npc.sendSimple();
		}
		if(type == 2){
			npc.addText("I'll make you a Glove if you get me some materials. What kind of Glove do you want?");
			for(int x = 0; x < mgx; x++){
				npc.addText("#b\r\n#L" + (x) + "##t" + mg[x] + "##k " + mginfo[x] + "#l");
			}
			npc.setState(39);
			npc.sendSimple();
		}
		if(type == 3){
			npc.addText("So you want to upgrade a Glove? Choose which one you would like to upgrade");
			for(int x = 0; x < upgx; x++){
				npc.addText("#b\r\n#L" + (x) + "##t" + upg[x] + "##k " + upginfo[x] + "#l");
			}
			npc.setState(29);
			npc.sendSimple();
		}
		if(type == 4){
			npc.addText("So you want to make materials, huh? Alright... what kind?");
			for(int x = 0; x < _MaterialMenux; x++){
				npc.addText("#b\r\n#L" + (x) + "#" + _MaterialMenu[x] + "#k#l");
			}
			npc.setState(19);
			npc.sendSimple();
		}
		else if(type == 5){
			npc.addText("So you want to make arrows? Choose which you would like me to make.");
			for(int x = 0; x < _ArrowMenux; x++){
				npc.addText("#b\r\n#L" + (x) + "#" + _ArrowMenu[x] + "#k#l");
			}
			npc.setState(9);
			npc.sendSimple();
		}

	}
	
// Make Bow

	else if(state == 60){
		npc.setGetSaveInt(type);

		if(npc.getSaveInt() == 0){
			_temp 		= _WarBow;
			_tempinfo 	= _WarBowinfo;
			_tempinfox 	= _WarBowinfox;
		}
		else if(npc.getSaveInt() == 1){
			_temp 		= _CompositeBow;
			_tempinfo 	= _CompositeBowinfo;
			_tempinfox 	= _CompositeBowinfox;
		}
		else if(npc.getSaveInt() == 2){
			_temp 		= _HuntersBow;
			_tempinfo 	= _HuntersBowinfo;
			_tempinfox 	= _HuntersBowinfox;
		}
		else if(npc.getSaveInt() == 3){
			_temp 		= _BattleBow;
			_tempinfo 	= _BattleBowinfo;
			_tempinfox 	= _BattleBowinfox;
		}
		else if(npc.getSaveInt() == 4){
			_temp 		= _Ryden;
			_tempinfo 	= _Rydeninfo;
			_tempinfox 	= _Rydeninfox;
		}
		else if(npc.getSaveInt() == 5){
			_temp 		= _RedViper;
			_tempinfo 	= _RedViperinfo;
			_tempinfox 	= _RedViperinfox;
		}
		else if(npc.getSaveInt() == 6){
			_temp 		= _Vaulter2000;
			_tempinfo 	= _Vaulter2000info;
			_tempinfox 	= _Vaulter2000infox;
		}

		for(int x = 1; x < _temp[0]; x++){
			if(_tempinfo[x] == 999){
				z = x;
			}
		}

		npc.addText("To make one #b#t" + _temp[z] + "##k,  I need the following items. " + mbinfo[npc.getSaveInt()] + " and please make sure you don't use an item that's been upgraded as a material for it. What do you think? Do you want one?");
	
		for(int i = 1; i < _temp[0]; i++){
			if(_temp[i] == 0){
				// ignore
			}
			else if(_tempinfo[i] == 0){
				npc.addText("#b\r\n#v4031138# " + _temp[i] + " mesos #k");
			}
			else if(_tempinfo[i] == 999){
				// nothing right now just to not show is as payment
			}
			else if(_tempinfo[i] > 1){
				npc.addText("#b\r\n#v" + _temp[i] + "# " + + _tempinfo[i] + " #t" + _temp[i] + "##k");
			}
			else {
				npc.addText("#b\r\n#v" + _temp[i] + "#  #t" + _temp[i] + "##k");
			}
		} 

		npc.sendYesNo();
	}

	else if(state == 61){

		if(npc.getSaveInt() == 0){
			_temp 		= _WarBow;
			_tempinfo 	= _WarBowinfo;
			_tempinfox 	= _WarBowinfox;
		}
		else if(npc.getSaveInt() == 1){
			_temp 		= _CompositeBow;
			_tempinfo 	= _CompositeBowinfo;
			_tempinfox 	= _CompositeBowinfox;
		}
		else if(npc.getSaveInt() == 2){
			_temp 		= _HuntersBow;
			_tempinfo 	= _HuntersBowinfo;
			_tempinfox 	= _HuntersBowinfox;
		}
		else if(npc.getSaveInt() == 3){
			_temp 		= _BattleBow;
			_tempinfo 	= _BattleBowinfo;
			_tempinfox 	= _BattleBowinfox;
		}
		else if(npc.getSaveInt() == 4){
			_temp 		= _Ryden;
			_tempinfo 	= _Rydeninfo;
			_tempinfox 	= _Rydeninfox;
		}
		else if(npc.getSaveInt() == 5){
			_temp 		= _RedViper;
			_tempinfo 	= _RedViperinfo;
			_tempinfox 	= _RedViperinfox;
		}
		else if(npc.getSaveInt() == 6){
			_temp 		= _Vaulter2000;
			_tempinfo 	= _Vaulter2000info;
			_tempinfox 	= _Vaulter2000infox;
		}

		if(npc.getSelected() == YES){

			type = 0;

			for(int x = 1; x < _temp[0]; x++){
				if(_temp[x] == 0){
					// ignore
				}
				else if(_tempinfo[x] == 0){
					if(player.getMesos() < _temp[x]){
						type = 1;
					}
				}
				else if(_tempinfo[x] == 999){
					// nothing just to skip it for now
				}
				else {
					if(player.getItemAmount(_temp[x]) < _tempinfo[x]){
						type = 1;
					}
				}
			}

			if(type == 0){
				for(int x = 1; x < _temp[0]; x++){
					if(_temp[x] == 0){
						// ignore
					}
					else if(_tempinfo[x] == 0){
						player.giveMesos(-_temp[x]);
					}
					else if(_tempinfo[x] == 999){
						player.giveItem(_temp[x], _tempinfox[x]);
					}
					else {
						player.giveItem(_temp[x], -_tempinfo[x]);
					}
				}

				npc.addText("Did it turn out OK? Well it looks like it did! Come back if you want to create something else.");
				npc.sendNext();
				npc.end();
			}
			else if (type == 1){
				npc.addText("Check and see if you have everything you need and if your equipment inventory is full or not.");
				npc.sendNext();
				npc.end();
			}
		}
		else if(npc.getSelected() == NO){
			npc.addText("I make important items for Bowmen and sell them for a reasonable price, so take your time and check them all out. You know nothing's free right?");
			npc.sendNext();
			npc.end();
		}
	}

// Make Crossbow

	else if(state == 50){
		npc.setGetSaveInt(type);

		if(npc.getSaveInt() == 0){
			_temp 		= _Crossbow;
			_tempinfo 	= _Crossbowinfo;
			_tempinfox 	= _Crossbowinfox;
		}
		else if(npc.getSaveInt() == 1){
			_temp 		= _BattleCrossbow;
			_tempinfo 	= _BattleCrossbowinfo;
			_tempinfox 	= _BattleCrossbowinfox;
		}
		else if(npc.getSaveInt() == 2){
			_temp 		= _Balanche;
			_tempinfo 	= _Balancheinfo;
			_tempinfox 	= _Balancheinfox;
		}
		else if(npc.getSaveInt() == 3){
			_temp 		= _MountainCrossbow;
			_tempinfo 	= _MountainCrossbowinfo;
			_tempinfox 	= _MountainCrossbowinfox;
		}
		else if(npc.getSaveInt() == 4){
			_temp 		= _EagleCrow;
			_tempinfo 	= _EagleCrowinfo;
			_tempinfox 	= _EagleCrowinfox;
		}
		else if(npc.getSaveInt() == 5){
			_temp 		= _Heckler;
			_tempinfo 	= _Hecklerinfo;
			_tempinfox 	= _Hecklerinfox;
		}
		else if(npc.getSaveInt() == 6){
			_temp 		= _SilverCrow;
			_tempinfo 	= _SilverCrowinfo;
			_tempinfox 	= _SilverCrowinfox;
		}
		else if(npc.getSaveInt() == 7){
			_temp 		= _Rower;
			_tempinfo 	= _Rowerinfo;
			_tempinfox 	= _Rowerinfox;
		}


		for(int x = 1; x < _temp[0]; x++){
			if(_tempinfo[x] == 999){
				z = x;
			}
		}

		npc.addText("To make one #b#t" + _temp[z] + "##k,  I need the following items. " + mcbinfo[npc.getSaveInt()] + " and please make sure you don't use an item that's been upgraded as a material for it. What do you think? Do you want one?");
	
		for(int i = 1; i < _temp[0]; i++){
			if(_temp[i] == 0){
				// ignore
			}
			else if(_tempinfo[i] == 0){
				npc.addText("#b\r\n#v4031138# " + _temp[i] + " mesos #k");
			}
			else if(_tempinfo[i] == 999){
				// nothing right now just to not show is as payment
			}
			else if(_tempinfo[i] > 1){
				npc.addText("#b\r\n#v" + _temp[i] + "# " + + _tempinfo[i] + " #t" + _temp[i] + "##k");
			}
			else {
				npc.addText("#b\r\n#v" + _temp[i] + "#  #t" + _temp[i] + "##k");
			}
		} 
		npc.sendYesNo();
	}

	else if(state == 51){

		if(npc.getSaveInt() == 0){
			_temp 		= _Crossbow;
			_tempinfo 	= _Crossbowinfo;
			_tempinfox 	= _Crossbowinfox;
		}
		else if(npc.getSaveInt() == 1){
			_temp 		= _BattleCrossbow;
			_tempinfo 	= _BattleCrossbowinfo;
			_tempinfox 	= _BattleCrossbowinfox;
		}
		else if(npc.getSaveInt() == 2){
			_temp 		= _Balanche;
			_tempinfo 	= _Balancheinfo;
			_tempinfox 	= _Balancheinfox;
		}
		else if(npc.getSaveInt() == 3){
			_temp 		= _MountainCrossbow;
			_tempinfo 	= _MountainCrossbowinfo;
			_tempinfox 	= _MountainCrossbowinfox;
		}
		else if(npc.getSaveInt() == 4){
			_temp 		= _EagleCrow;
			_tempinfo 	= _EagleCrowinfo;
			_tempinfox 	= _EagleCrowinfox;
		}
		else if(npc.getSaveInt() == 5){
			_temp 		= _Heckler;
			_tempinfo 	= _Hecklerinfo;
			_tempinfox 	= _Hecklerinfox;
		}
		else if(npc.getSaveInt() == 6){
			_temp 		= _SilverCrow;
			_tempinfo 	= _SilverCrowinfo;
			_tempinfox 	= _SilverCrowinfox;
		}
		else if(npc.getSaveInt() == 7){
			_temp 		= _Rower;
			_tempinfo 	= _Rowerinfo;
			_tempinfox 	= _Rowerinfox;
		}

		if(npc.getSelected() == YES){

			type = 0;

			for(int x = 1; x < _temp[0]; x++){
				if(_temp[x] == 0){
					// ignore
				}
				else if(_tempinfo[x] == 0){
					if(player.getMesos() < _temp[x]){
						type = 1;
					}
				}
				else if(_tempinfo[x] == 999){
					// nothing just to skip it for now
				}
				else {
					if(player.getItemAmount(_temp[x]) < _tempinfo[x]){
						type = 1;
					}
				}
			}

			if(type == 0){
				for(int x = 1; x < _temp[0]; x++){
					if(_temp[x] == 0){
						// ignore
					}
					else if(_tempinfo[x] == 0){
						player.giveMesos(-_temp[x]);
					}
					else if(_tempinfo[x] == 999){
						player.giveItem(_temp[x], _tempinfox[x]);
					}
					else {
						player.giveItem(_temp[x], -_tempinfo[x]);
					}
				}

				npc.addText("Did it turn out OK? Well it looks like it did! Come back if you want to create something else.");
				npc.sendNext();
				npc.end();
			}
			else if (type == 1){
				npc.addText("Check and see if you have everything you need and if your equipment inventory is full or not.");
				npc.sendNext();
				npc.end();
			}

		}
		else if(npc.getSelected() == NO){
			npc.addText("I make important items for Bowmen and sell them for a reasonable price, so take your time and check them all out. You know nothing's free right?");
			npc.sendNext();
			npc.end();
		}
	}

// Make Glove

	else if(state == 40){
		npc.setGetSaveInt(type);

		if(npc.getSaveInt() == 0){
			_temp 		= _BasicArcherGlove;
			_tempinfo 	= _BasicArcherGloveinfo;
			_tempinfox 	= _BasicArcherGloveinfox;
		}
		else if(npc.getSaveInt() == 1){
			_temp 		= _BlueDiros;
			_tempinfo 	= _BlueDirosinfo;
			_tempinfox 	= _BlueDirosinfox;
		}
		else if(npc.getSaveInt() == 2){
			_temp 		= _BlueSavata;
			_tempinfo 	= _BlueSavatainfo;
			_tempinfox 	= _BlueSavatainfox;
		}
		else if(npc.getSaveInt() == 3){
			_temp 		= _BrownMarker;
			_tempinfo 	= _BrownMarkerinfo;
			_tempinfox 	= _BrownMarkerinfox;
		}
		else if(npc.getSaveInt() == 4){
			_temp 		= _BronzeScaler;
			_tempinfo 	= _BronzeScalerinfo;
			_tempinfox 	= _BronzeScalerinfox;
		}
		else if(npc.getSaveInt() == 5){
			_temp 		= _AquaBrace;
			_tempinfo 	= _AquaBraceinfo;
			_tempinfox 	= _AquaBraceinfox;
		}
		else if(npc.getSaveInt() == 6){
			_temp 		= _BlueWillow;
			_tempinfo 	= _BlueWillowinfo;
			_tempinfox 	= _BlueWillowinfox;
		}
		else if(npc.getSaveInt() == 7){
			_temp 		= _OakerGarner;
			_tempinfo 	= _OakerGarnerinfo;
			_tempinfox 	= _OakerGarnerinfox;
		}

		for(int x = 1; x < _temp[0]; x++){
			if(_tempinfo[x] == 999){
				z = x;
			}
		}

		npc.addText("To make one #b#t" + _temp[z] + "##k,  I need the following items. " + mginfo[npc.getSaveInt()] + " and please make sure you don't use an item that's been upgraded as a material for it. What do you think? Do you want one?");
	
		for(int i = 1; i < _temp[0]; i++){
			if(_tempinfo[i] == 0){
				npc.addText("#b\r\n#v4031138# " + _temp[i] + " mesos #k");
			}
			else if(_tempinfo[i] == 999){
				// nothing right now just to not show is as payment
			}
			else if(_tempinfo[i] > 1){
				npc.addText("#b\r\n#v" + _temp[i] + "# " + + _tempinfo[i] + " #t" + _temp[i] + "##k");
			}
			else {
				npc.addText("#b\r\n#v" + _temp[i] + "#  #t" + _temp[i] + "##k");
			}
		} 

		npc.sendYesNo();
	}

	else if(state == 41){

		if(npc.getSaveInt() == 0){
			_temp 		= _BasicArcherGlove;
			_tempinfo 	= _BasicArcherGloveinfo;
			_tempinfox 	= _BasicArcherGloveinfox;
		}
		else if(npc.getSaveInt() == 1){
			_temp 		= _BlueDiros;
			_tempinfo 	= _BlueDirosinfo;
			_tempinfox 	= _BlueDirosinfox;
		}
		else if(npc.getSaveInt() == 2){
			_temp 		= _BlueSavata;
			_tempinfo 	= _BlueSavatainfo;
			_tempinfox 	= _BlueSavatainfox;
		}
		else if(npc.getSaveInt() == 3){
			_temp 		= _BrownMarker;
			_tempinfo 	= _BrownMarkerinfo;
			_tempinfox 	= _BrownMarkerinfox;
		}
		else if(npc.getSaveInt() == 4){
			_temp 		= _BronzeScaler;
			_tempinfo 	= _BronzeScalerinfo;
			_tempinfox 	= _BronzeScalerinfox;
		}
		else if(npc.getSaveInt() == 5){
			_temp 		= _AquaBrace;
			_tempinfo 	= _AquaBraceinfo;
			_tempinfox 	= _AquaBraceinfox;
		}
		else if(npc.getSaveInt() == 6){
			_temp 		= _BlueWillow;
			_tempinfo 	= _BlueWillowinfo;
			_tempinfox 	= _BlueWillowinfox;
		}
		else if(npc.getSaveInt() == 7){
			_temp 		= _OakerGarner;
			_tempinfo 	= _OakerGarnerinfo;
			_tempinfox 	= _OakerGarnerinfox;
		}

		if(npc.getSelected() == YES){

			type = 0;

			for(int x = 1; x < _temp[0]; x++){

				if(_tempinfo[x] == 0){
					if(player.getMesos() < _temp[x]){
						type = 1;
					}
				}
				else if(_tempinfo[x] == 999){
					// nothing just to skip it for now
				}
				else {
					if(player.getItemAmount(_temp[x]) < _tempinfo[x]){
						type = 1;
					}
				}
			}

			if(type == 0){
				for(int x = 1; x < _temp[0]; x++){

					if(_tempinfo[x] == 0){
						player.giveMesos(-_temp[x]);
					}
					else if(_tempinfo[x] == 999){
						player.giveItem(_temp[x], _tempinfox[x]);
					}
					else {
						player.giveItem(_temp[x], -_tempinfo[x]);
					}
				}
				npc.addText("Did it turn out OK? Well it looks like it did! Come back if you want to create something else.");
				npc.sendNext();
				npc.end();
			}
			else if (type == 1){
				npc.addText("Check and see if you have everything you need and if your equipment inventory is full or not.");
				npc.sendNext();
				npc.end();
			}
		}
		else if(npc.getSelected() == NO){
			npc.addText("I make important items for Bowmen and sell them for a reasonable price, so take your time and check them all out. You know nothing's free right?");
			npc.sendNext();
			npc.end();
		}
	}

// Upgrade Glove

	else if(state == 30){
		npc.setGetSaveInt(type);

		if(npc.getSaveInt() == 0){
			_temp 		= _RedDiros;
			_tempinfo 	= _RedDirosinfo;
			_tempinfox 	= _RedDirosinfox;
		}
		else if(npc.getSaveInt() == 1){
			_temp 		= _GreenDiros;
			_tempinfo 	= _GreenDirosinfo;
			_tempinfox 	= _GreenDirosinfox;
		}
		else if(npc.getSaveInt() == 2){
			_temp 		= _RedSavanta;
			_tempinfo 	= _RedSavantainfo;
			_tempinfox 	= _RedSavantainfox;
		}
		else if(npc.getSaveInt() == 3){
			_temp 		= _DarkSavanta;
			_tempinfo 	= _DarkSavantainfo;
			_tempinfox 	= _DarkSavantainfox;
		}
		else if(npc.getSaveInt() == 4){
			_temp 		= _GreenMarker;
			_tempinfo 	= _GreenMarkerinfo;
			_tempinfox 	= _GreenMarkerinfox;
		}
		else if(npc.getSaveInt() == 5){
			_temp 		= _BlackMarker;
			_tempinfo 	= _BlackMarkerinfo;
			_tempinfox 	= _BlackMarkerinfox;
		}
		else if(npc.getSaveInt() == 6){
			_temp 		= _MithrilScaler;
			_tempinfo 	= _MithrilScalerinfo;
			_tempinfox 	= _MithrilScalerinfox;
		}
		else if(npc.getSaveInt() == 7){
			_temp 		= _GoldScaler;
			_tempinfo 	= _GoldScalerinfo;
			_tempinfox 	= _GoldScalerinfox;
		}
		else if(npc.getSaveInt() == 8){
			_temp 		= _GoldBrace;
			_tempinfo 	= _GoldBraceinfo;
			_tempinfox 	= _GoldBraceinfox;
		}
		else if(npc.getSaveInt() == 9){
			_temp 		= _DarkBrace;
			_tempinfo 	= _DarkBraceinfo;
			_tempinfox 	= _DarkBraceinfox;
		}
		else if(npc.getSaveInt() == 10){
			_temp 		= _RedWillow;
			_tempinfo 	= _RedWillowinfo;
			_tempinfox 	= _RedWillowinfox;
		}
		else if(npc.getSaveInt() == 11){
			_temp 		= _DarkWillow;
			_tempinfo 	= _DarkWillowinfo;
			_tempinfox 	= _DarkWillowinfox;
		}
		else if(npc.getSaveInt() == 12){
			_temp 		= _SephiaGarner;
			_tempinfo 	= _SephiaGarnerinfo;
			_tempinfox 	= _SephiaGarnerinfox;
		}
		else if(npc.getSaveInt() == 13){
			_temp 		= _DarkGarber;
			_tempinfo 	= _DarkGarberinfo;
			_tempinfox 	= _DarkGarberinfox;
		}

		for(int x = 1; x < _temp[0]; x++){
			if(_tempinfo[x] == 999){
				z = x;
			}
		}

		npc.addText("To upgrade one #b#t" + _temp[z] + "##k,  I need the following items. " + upginfo[npc.getSaveInt()] + " and please make sure you don't use an item that's been upgraded as a material for it. What do you think? Do you want one?");
	
		for(int i = 1; i < _temp[0]; i++){
			if(_tempinfo[i] == 0){
				npc.addText("#b\r\n#v4031138# " + _temp[i] + " mesos #k");
			}
			else if(_tempinfo[i] == 999){
				// nothing right now just to not show is as payment
			}
			else if(_tempinfo[i] > 1){
				npc.addText("#b\r\n#v" + _temp[i] + "# " + + _tempinfo[i] + " #t" + _temp[i] + "##k");
			}
			else {
				npc.addText("#b\r\n#v" + _temp[i] + "#  #t" + _temp[i] + "##k");
			}
		} 
		npc.sendYesNo();
	}

	else if(state == 31){

		if(npc.getSaveInt() == 0){
			_temp 		= _RedDiros;
			_tempinfo 	= _RedDirosinfo;
			_tempinfox 	= _RedDirosinfox;
		}
		else if(npc.getSaveInt() == 1){
			_temp 		= _GreenDiros;
			_tempinfo 	= _GreenDirosinfo;
			_tempinfox 	= _GreenDirosinfox;
		}
		else if(npc.getSaveInt() == 2){
			_temp 		= _RedSavanta;
			_tempinfo 	= _RedSavantainfo;
			_tempinfox 	= _RedSavantainfox;
		}
		else if(npc.getSaveInt() == 3){
			_temp 		= _DarkSavanta;
			_tempinfo 	= _DarkSavantainfo;
			_tempinfox 	= _DarkSavantainfox;
		}
		else if(npc.getSaveInt() == 4){
			_temp 		= _GreenMarker;
			_tempinfo 	= _GreenMarkerinfo;
			_tempinfox 	= _GreenMarkerinfox;
		}
		else if(npc.getSaveInt() == 5){
			_temp 		= _BlackMarker;
			_tempinfo 	= _BlackMarkerinfo;
			_tempinfox 	= _BlackMarkerinfox;
		}
		else if(npc.getSaveInt() == 6){
			_temp 		= _MithrilScaler;
			_tempinfo 	= _MithrilScalerinfo;
			_tempinfox 	= _MithrilScalerinfox;
		}
		else if(npc.getSaveInt() == 7){
			_temp 		= _GoldScaler;
			_tempinfo 	= _GoldScalerinfo;
			_tempinfox 	= _GoldScalerinfox;
		}
		else if(npc.getSaveInt() == 8){
			_temp 		= _GoldBrace;
			_tempinfo 	= _GoldBraceinfo;
			_tempinfox 	= _GoldBraceinfox;
		}
		else if(npc.getSaveInt() == 9){
			_temp 		= _DarkBrace;
			_tempinfo 	= _DarkBraceinfo;
			_tempinfox 	= _DarkBraceinfox;
		}
		else if(npc.getSaveInt() == 10){
			_temp 		= _RedWillow;
			_tempinfo 	= _RedWillowinfo;
			_tempinfox 	= _RedWillowinfox;
		}
		else if(npc.getSaveInt() == 11){
			_temp 		= _DarkWillow;
			_tempinfo 	= _DarkWillowinfo;
			_tempinfox 	= _DarkWillowinfox;
		}
		else if(npc.getSaveInt() == 12){
			_temp 		= _SephiaGarner;
			_tempinfo 	= _SephiaGarnerinfo;
			_tempinfox 	= _SephiaGarnerinfox;
		}
		else if(npc.getSaveInt() == 13){
			_temp 		= _DarkGarber;
			_tempinfo 	= _DarkGarberinfo;
			_tempinfox 	= _DarkGarberinfox;
		}

		if(npc.getSelected() == YES){

			type = 0;

			for(int x = 1; x < _temp[0]; x++){

				if(_tempinfo[x] == 0){
					if(player.getMesos() < _temp[x]){
						type = 1;
					}
				}
				else if(_tempinfo[x] == 999){
					// nothing just to skip it for now
				}
				else {
					if(player.getItemAmount(_temp[x]) < _tempinfo[x]){
						type = 1;
					}
				}
			}

			if(type == 0){
				for(int x = 1; x < _temp[0]; x++){

					if(_tempinfo[x] == 0){
						player.giveMesos(-_temp[x]);
					}
					else if(_tempinfo[x] == 999){
						player.giveItem(_temp[x], _tempinfox[x]);
					}
					else {
						player.giveItem(_temp[x], -_tempinfo[x]);
					}
				}

				npc.addText("Did it turn out OK? Well it looks like it did! Come back if you want to upgrade something else.");
				npc.sendNext();
				npc.end();
			}
			else if (type == 1){
				npc.addText("Check and see if you have everything you need and if your equipment inventory is full or not.");
				npc.sendNext();
				npc.end();
			}

		}
		else if(npc.getSelected() == NO){
			npc.addText("I make important items for Bowmen and sell them for a reasonable price, so take your time and check them all out. You know nothing's free right?");
			npc.sendNext();
			npc.end();
		}
	}

// Materials

	else if(state == 20){
		npc.setGetSaveInt(type);

		if(npc.getSaveInt() == 0){
			_temp = _ProcessedWood_v1;
			_tempinfo = _ProcessedWood_v1info;
			_tempinfox = _ProcessedWood_v1infox;
		}
		else if(npc.getSaveInt() == 1){
			_temp = _ProcessedWood_v2;
			_tempinfo = _ProcessedWood_v2info;
			_tempinfox = _ProcessedWood_v2infox;
		}
		else if(npc.getSaveInt() == 2){
			_temp = _Screws;
			_tempinfo = _Screwsinfo;
			_tempinfox = _Screwsinfox;
		}

		npc.addText("To make #b" + _tempinfox[1] + " #t" + _temp[1] + "##k I need following material(s) each. How many do you want to make?");
	
		for(int i = 1; i < _temp[0]; i++){
			if(_tempinfo[i] == 0){
				npc.addText("#b\r\n#v4031138# " + _temp[i] + " mesos #k");
			}
			else if(_tempinfo[i] == 999){
				// nothing right now just to not show is as payment
			}
			else if(_tempinfo[i] > 1){
				npc.addText("#b\r\n#v" + _temp[i] + "# " + + _tempinfo[i] + " #t" + _temp[i] + "##k");
			}
			else {
				npc.addText("#b\r\n#v" + _temp[i] + "#  #t" + _temp[i] + "##k");
			}
		}
		npc.sendGetNumber(0,0,100);
	}


	else if(state == 21){
		if(npc.getSaveInt() == 0){
			_temp = _ProcessedWood_v1;
			_tempinfo = _ProcessedWood_v1info;
			_tempinfox = _ProcessedWood_v1infox;
		}
		else if(npc.getSaveInt() == 1){
			_temp = _ProcessedWood_v2;
			_tempinfo = _ProcessedWood_v2info;
			_tempinfox = _ProcessedWood_v2infox;
		}
		else if(npc.getSaveInt() == 2){
			_temp = _Screws;
			_tempinfo = _Screwsinfo;
			_tempinfox = _Screwsinfox;
		}
		npc.addText("Do you want to make #b#t" + _temp[1] + "# " + npc.getNumber() + "#k time(s)? I need these materials to do it.");

		for(int i = 1; i < _temp[0]; i++){
			if(_tempinfo[i] == 0){
				npc.addText("#b\r\n#v4031138# " + _temp[i]*npc.getNumber() + " mesos #k");
			}
			else if(_tempinfo[i] == 999){
				// nothing right now just to not show is as payment
			}
			else if(_tempinfo[i]*npc.getNumber() > 2){
				npc.addText("#b\r\n#v" + _temp[i] + "# " + + _tempinfo[i]*npc.getNumber() + " #t" + _temp[i] + "##k");
			}
			else {
				npc.addText("#b\r\n#v" + _temp[i] + "#  #t" + _temp[i] + "##k");
			}
		} 
		npc.sendYesNo();
	}

	else if(state == 22){

		if(npc.getSaveInt() == 0){
			_temp = _ProcessedWood_v1;
			_tempinfo = _ProcessedWood_v1info;
			_tempinfox = _ProcessedWood_v1infox;
		}
		else if(npc.getSaveInt() == 1){
			_temp = _ProcessedWood_v2;
			_tempinfo = _ProcessedWood_v2info;
			_tempinfox = _ProcessedWood_v2infox;
		}
		else if(npc.getSaveInt() == 2){
			_temp = _Screws;
			_tempinfo = _Screwsinfo;
			_tempinfox = _Screwsinfox;
		}

		if(npc.getSelected() == YES){

			type = 0;

			for(int x = 1; x < _temp[0]; x++){

				if(_tempinfo[x] == 0){
					if(player.getMesos() < _temp[x]*npc.getNumber()){
						type = 1;
					}
				}
				else if(_tempinfo[x] == 999){
					// nothing just to skip it for now
				}
				else {
					if(player.getItemAmount(_temp[x]) < _tempinfo[x]*npc.getNumber()){
						type = 1;
					}
				}
			}

			if(type == 0){
				for(int x = 1; x < _temp[0]; x++){

					if(_tempinfo[x] == 0){
						player.giveMesos(-_temp[x]*npc.getNumber());
					}
					else if(_tempinfo[x] == 999){
						player.giveItem(_temp[x], _tempinfox[x]*npc.getNumber());
					}
					else {
						player.giveItem(_temp[x], -_tempinfo[x]*npc.getNumber());
					}
				}
				npc.addText("Did it turn out OK? Well it looks like it did! Come back if you want to create something else.");
				npc.sendNext();
				npc.end();
			}
			else if (type == 1){
				npc.addText("Check and see if you have everything you need and if your equipment inventory is full or not.");
				npc.sendNext();
				npc.end();
			}
		}
		else if(npc.getSelected() == NO){
			npc.addText("I make important items for Bowmen and sell them for a reasonable price, so take your time and check them all out. You know nothing's free right?");
			npc.sendNext();
			npc.end();
		}
	}

// Arrows
	
	else if(state == 10){
		npc.setGetSaveInt(type);

		if(npc.getSaveInt() == 0){
			_temp = _Bow;
			_tempinfo = _Bowinfo;
			_tempinfox = _Bowinfox;
		}
		else if(npc.getSaveInt() == 1){
			_temp = _CBow;
			_tempinfo = _CBowinfo;
			_tempinfox = _CBowinfox;
		}
		else if(npc.getSaveInt() == 2){
			_temp = _BBow;
			_tempinfo = _BBowinfo;
			_tempinfox = _BBowinfox;
		}
		else if(npc.getSaveInt() == 3){
			_temp = _BCBow;
			_tempinfo = _BCBowinfo;
			_tempinfox = _BCBowinfox;
		}
		npc.addText("To make #b" + _tempinfox[1] + " #t" + _temp[1] + "#(s)#k, I need the following items. If you have the materials, it'll be much better for you to do it here as opposed to buy it at the store. Do you really want it?");

		for(int i = 1; i < _temp[0]; i++){
			if(_tempinfo[i] == 0){
				npc.addText("#b\r\n#v4031138# " + _temp[i] + " mesos #k");
			}
			else if(_tempinfo[i] == 999){
				// nothing right now just to not show is as payment
			}
			else if(_tempinfo[i] > 1){
				npc.addText("#b\r\n#v" + _temp[i] + "# " + + _tempinfo[i] + " #t" + _temp[i] + "##k");
			}
			else {
				npc.addText("#b\r\n#v" + _temp[i] + "#  #t" + _temp[i] + "##k");
			}
		} 
		npc.sendYesNo();

	}
	else if(state == 11){

		if(npc.getSaveInt() == 0){
			_temp = _Bow;
			_tempinfo = _Bowinfo;
			_tempinfox = _Bowinfox;
		}
		else if(npc.getSaveInt() == 1){
			_temp = _CBow;
			_tempinfo = _CBowinfo;
			_tempinfox = _CBowinfox;
		}
		else if(npc.getSaveInt() == 2){
			_temp = _BBow;
			_tempinfo = _BBowinfo;
			_tempinfox = _BBowinfox;
		}
		else if(npc.getSaveInt() == 3){
			_temp = _BCBow;
			_tempinfo = _BCBowinfo;
			_tempinfox = _BCBowinfox;
		}

		if(npc.getSelected() == YES){

			type = 0;

			for(int x = 1; x < _temp[0]; x++){

				if(_tempinfo[x] == 0){
					if(player.getMesos() < _temp[x]){
						type = 1;
					}
				}
				else if(_tempinfo[x] == 999){
					// nothing just to skip it for now
				}
				else {
					if(player.getItemAmount(_temp[x]) < _tempinfo[x]){
						type = 1;
					}
				}
			}
			if(type == 0){
				for(int x = 1; x < _temp[0]; x++){

					if(_tempinfo[x] == 0){
						player.giveMesos(-_temp[x]);
					}
					else if(_tempinfo[x] == 999){
						player.giveItem(_temp[x], _tempinfox[x]);
					}
					else {
						player.giveItem(_temp[x], -_tempinfo[x]);
					}
				}

				npc.addText("Did it turn out OK? Well it looks like it did! Come back if you want to create something else.");
				npc.sendNext();
				npc.end();
			}
			else if (type == 1){
				npc.addText("Check and see if you have everything you need and if your equipment inventory is full or not.");
				npc.sendNext();
				npc.end();
			}
		}
		else if(npc.getSelected() == NO){
			npc.addText("I make important items for Bowmen and sell them for a reasonable price, so take your time and check them all out. You know nothing's free right?");
			npc.sendNext();
			npc.end();
		}
	}
}